Skip to content

Conversation

@MartinWheelerMT
Copy link
Collaborator

@MartinWheelerMT MartinWheelerMT commented May 14, 2025

What

  • Add ErrorHandler for XML/XSD schema validation errors.
  • Add Schema validator which retrieves the configured redactions context and validates against the corresponding schema.
  • Add functionality to output the validation errors in a log file.
  • Inject and use schema validation when running the transformation process.
  • Update developer information.
  • Add SonarQube exclusion for transformJsonToXmlTool as it is a developer only internal validation tool and is not tested currently.

Why

The transform tool will report errors if the resultant transform does not pass schema validation. This is a useful step in being able to diagnose problems with any produced transformation

Type of change

Please delete options that are not relevant.

  • Internal change (non-breaking change with no effect on the functionality affecting end users)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

* Add ErrorHandler for XML/XSD schema validation errors.
* Add Schema validator which retrieves the configured redactions context and validates against the corresponding schema.
* Add functionality to output the validation errors in a log file.
* Inject and use schema validation when running the transformation process.
* Update developer information.
@MartinWheelerMT MartinWheelerMT force-pushed the add-schema-validation-to-transform-tool branch from a5a18ae to c902067 Compare May 20, 2025 12:51
* Update XmlSchemaValidator to use newDefaultInstance instead
* Update XmlSchemaValidator to use newDefaultInstance instead
@NHSDigital NHSDigital deleted a comment from sonarqubecloud bot May 20, 2025
* Update XmlSchemaValidator to use newDefaultInstance instead
@MartinWheelerMT MartinWheelerMT force-pushed the add-schema-validation-to-transform-tool branch from 2d50466 to a26e9cd Compare May 22, 2025 08:41
@NHSDigital NHSDigital deleted a comment from sonarqubecloud bot May 22, 2025
@MartinWheelerMT MartinWheelerMT changed the title Add Schema validation to transform tool Add Schema validation to transformJsonToXml developer tool May 22, 2025
* Changed logging to `Error` when the schema file could not be loaded.
* Renamed parameter `filename` to be more specific about its intent.
…ontoxmltool` to address checkstyle package name issues
@github-actions
Copy link

  • Surviving mutants in this change: 16
  • Killed mutants in this change: 0
class surviving killed
🧟uk.nhs.adaptors.gp2gp.transformjsontoxmltool.XmlSchemaValidator 12 0
🧟uk.nhs.adaptors.gp2gp.transformjsontoxmltool.XsdErrorHandler 2 0
🧟uk.nhs.adaptors.gp2gp.transformjsontoxmltool.TransformJsonToXml 2 0

See https://pitest.org

@sonarqubecloud
Copy link

@MartinWheelerMT MartinWheelerMT merged commit b706380 into main May 22, 2025
15 checks passed
@MartinWheelerMT MartinWheelerMT deleted the add-schema-validation-to-transform-tool branch May 22, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants